package com.zwl.sjzmanagement.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zwl.model.ExpansionBox;
import com.zwl.sjzmanagement.mapper.ExpansionBoxMapper;
import com.zwl.sjzmanagement.service.ExpansionBoxService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ExpansionBoxServiceImpl extends ServiceImpl<ExpansionBoxMapper,ExpansionBox> implements ExpansionBoxService {

    @Autowired
    private ExpansionBoxMapper expansionBoxMapper;

    @Override
    public List<ExpansionBox> expansionBoxList(IPage<ExpansionBox> page) {
        if (page.getCurrent() <= 0) {
            page.setCurrent(1); // 默认第一页
        }
        if (page.getSize() <= 0) {
            page.setSize(10); // 默认每页10条
        }

        return expansionBoxMapper.expansionBoxList(page);


    }
}
